package com.thingsgrid.basicInterface.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.thingsgrid.basicInterface.entity.BasicInterface;
import com.thingsgrid.basicInterface.vo.BasicInterfaceVo;
import com.thingsgrid.basicInterface.mapper.BasicInterfaceMapper;
import com.thingsgrid.basicInterface.service.IBasicInterfaceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2019-08-10
 */
@Service
public class BasicInterfaceServiceImpl extends ServiceImpl<BasicInterfaceMapper, BasicInterface> implements IBasicInterfaceService {

	@Override
	public IPage<BasicInterfaceVo> selectBasicInterfacePage(IPage<BasicInterfaceVo> page, BasicInterfaceVo basicInterface) {
		return page.setRecords(baseMapper.selectBasicInterfacePage(page, basicInterface));
	}

	@Override
	public IPage<BasicInterfaceVo> selectApiandTypeName(IPage<BasicInterfaceVo> page, Wrapper<BasicInterfaceVo> wrapper) {
		return page.setRecords(baseMapper.findApiAndTypeNamePage(page, wrapper));
	}

	@Override
	public List<BasicInterface> selectByTypeId(Long id) {
		return baseMapper.findApiByPackage(id);
	}
}
